from selenium.webdriver.support.wait import WebDriverWait


# 封装find_element

def find_element(wd,find_type,expression):
    try:
        element = WebDriverWait(wd,20).until(lambda wd:wd.find_element(by=find_type,value=expression))
        return element
    except Exception as e :
        raise e



def find_elements(wd,find_type,expression):
    try:
        element = WebDriverWait(wd,20).until(lambda wd:wd.find_elements(by=find_type,value=expression))
        return element
    except Exception as e :
        raise e